public class Day2 {
    static int n;
    static int[][] book = new int[][]{{0,0}};
    static int dx[] = {0, 0, 1, -1};
    static int dy[] = {1, -1, 0, 0};
    static int[][] map = {
            {0, 1, 0, 0, 0, 0},
            {0, 0, 0, 1, 0, 0},
            {0, 0, 1, 0, 0, 1},
            {1, 1, 0, 0, 0, 0}
    };
    static void dfs(int x, int y) {
        if (x == 3 && y == 5) {
            System.out.println("1");
            return;
        }
        for (int i = 0; i <= 3; i++) {
//            if(x + dx[i] <6){
                int tx = x + dx[i];
//            }

            int ty = y + dy[i];
            if(tx<0 || ty<0 || tx>3 || ty>5) {
                continue;
            }
            if(map[tx][ty]==1 ){
                if(book[tx][ty]==1)
                    continue;
            }
            //传递下一个点
            book[tx][ty] = 1;
            if(tx < 6 && ty <6)
            dfs(tx,ty);
            book[tx][ty] = 0;
        }
        return ;
    }
    public static void main(String[] args) {
        book[0][0]=1;
        dfs(0,0);
    }
}
